<?php

namespace App\Http\Controllers;

use App\Models\Goods;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Traits\FormatResponseTrait;
class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests,FormatResponseTrait;

    /**
     * 修改公示期的产品状态
     */
    public function  __construct()
    {

        //修改公示期开始
        Goods::where(['status'=>2,'auction_status'=>0])->where('publicity','<=',date('Y-m-d H:i:s'))->update(['auction_status'=>1]);
        //修改拍卖中
        Goods::where(['status'=>2,'auction_status'=>1])->where('auction','<=',date('Y-m-d H:i:s'))->update(['auction_status'=>2]);


    }
}
